package com.itshizhan.itjidancideveloper.configs

import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import springfox.documentation.builders.ApiInfoBuilder
import springfox.documentation.oas.annotations.EnableOpenApi
import springfox.documentation.service.ApiInfo
import springfox.documentation.service.Contact
import springfox.documentation.spi.DocumentationType
import springfox.documentation.spring.web.plugins.Docket

@Configuration
@EnableOpenApi
class Swagger3Config {
  @Bean
  fun createApi(): Docket {
    return Docket(DocumentationType.OAS_30)
        .apiInfo(apiInfo())
        .select()
        .build()
  }

  private fun apiInfo(): ApiInfo? {
    return ApiInfoBuilder()
        .title("Itjidanci接口文档")
        .description("基于Kotlin，Springboot实现的开放式Api")
        .version("1.0.0")
        .contact(Contact("itshizhan","itjidanci.itshizhan.com","370424110@qq.com"))
        .build()
  }

}